import static org.junit.Assert.*;

import java.util.Calendar;
import java.util.Date;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import reittiopas.TimeFormatter;


public class TestTimeFormatter {

	
	private TimeFormatter tf;
	@Before
	public void setUp() throws Exception {
		tf = new TimeFormatter();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testTrimTimeStringReturnsValidTime() {
		
		String time = "12:30";
		String response = tf.trimTimeString(time);
		assertEquals("1230", response);
		
	}
	
	@Test(expected=RuntimeException.class)
	public void testTrimTimeStringThrowsExceptionWhenInputInvalid() {
		
		String time = "";
		String response = tf.trimTimeString(time);
		
	}
	
	@Test(expected=RuntimeException.class)
	public void testTrimTimeStringThrowsExceptionWhenInputTooLong() {
		
		String time = "12:456";
		String response = tf.trimTimeString(time);
		
	}
	

}
